package com.shf.lease.web.admin.config.webmvc;

import com.shf.lease.web.admin.converter.StringToBaseEnumConverterFactory;
import com.shf.lease.web.admin.converter.StringToItemTypeConverter;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Configuration;
import org.springframework.format.FormatterRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 叶枫
 * @date 2024/7/4.
 * 枚举转换
 */

@Configuration
public class WebMvcConfiguration implements WebMvcConfigurer {

     @Resource
     private StringToBaseEnumConverterFactory stringToBaseEnumConverterFactory;
    public void addFormatters(FormatterRegistry registry){
        registry.addConverterFactory(this.stringToBaseEnumConverterFactory);
    }
}
